﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Convertor.Interface;

namespace Convertor
{
    /// <summary>
    /// LoadPluginForm.xaml 的交互逻辑
    /// </summary>
    public partial class LoadPluginForm : Window, IManagePluginControl
    {
        private ManagePluginControl pluginControl;
        
        public LoadPluginForm()
        {
            pluginControl = new ManagePluginControl();
            InitializeComponent();
        }

        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            PluginLoader.Children.Add(pluginControl);
            ((IMyWindows)pluginControl).MyWindows = this;

        }
  
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        #region IManagePluginControl 成员

        public Dictionary<string, object> AllPlugins
        {
            get
            {
                return ((IManagePluginControl)pluginControl).AllPlugins;
            }
            set
            {
                ((IManagePluginControl)pluginControl).AllPlugins = value;
            }
        }

        public string ConfigPath
        {
            get
            {
                return ((IManagePluginControl)pluginControl).ConfigPath;
            }
            set
            {
                ((IManagePluginControl)pluginControl).ConfigPath = value;
            }
        }

        public string DefaultPlugConfigPath
        {
            get
            {
                return ((IManagePluginControl)pluginControl).DefaultPlugConfigPath;
            }
            set
            {
                ((IManagePluginControl)pluginControl).DefaultPlugConfigPath = value;
            }
        }


        public List<ISelectedPluginContent> SelectedPlugins
        {
            get
            {
                return ((IManagePluginControl)pluginControl).SelectedPlugins;
            }
            set
            {
                ((IManagePluginControl)pluginControl).SelectedPlugins = value;
            }
        }

        #endregion
    }
}
